<script>
$(document).ready(function() {
	<?php	
	if($updated == 1) echo 'showNoti("Bình luận: '.$name.'", "Cập nhập trả lời thành công!", "Ok");';
	if($added == 1) echo 'showNoti("Bình luận: '.$name.'", "Viết trả lời thành công!", "Ok");';
	if($failed == 1) echo 'showNoti("Bình luận: '.$name.'", "Cập nhập trả lời thất bại!", "Err");';
    ?>
});
</script>
<?php echo module_open(); ?>
<tr>
    <?php if ($GLOBALS['per']['del']) echo '<td class="head center" width="1%"><input type="checkbox" class="checkAll" /></td>'; ?>
  	<td class="head center" width="2%">#</td>
    <td class="head" width="20%">Email</td>
    <td class="head hide640" width="30%">Trang bình luận</td>
    <td class="head hide640" width="10%">Thời gian</td>
    <td class="head hide768" width="5%">IP</td>
    <td class="head center hide480" width="5%">Hiển thị</td>
  	<td class="head center" width="1%">&nbsp;</td>
</tr>
<?php
if(count($comments) && is_array($comments))
{
	$i = 1;
	foreach ($comments as $row)
	{
?>
<tr class="highlight<?php echo ($row['isnew'] ? ' table-flag-red' : '') ?>" id="<?php echo $row['id'] ?>" name="<?php echo $row['email'] ?>">
	<?php if ($GLOBALS['per']['del']) echo '<td class="fr center">'.sel_item($row['id']).'</td>'; ?>
	<td class="fr center"><?php echo stt($row['id'], $GLOBALS['var']['rowstart'] + $i++) ?></td>
	<td class="fr"><?php echo $row['email'] ?></td>
	<td class="fr hide640">
		<?php echo $row['product'] ?>
		<?php echo $row['project'] ?>
		<?php echo $row['article'] ?>
		<?php echo $row['service'] ?>
		<?php echo $row['video'] ?>
	</td>
	<td class="fr hide640"><?php echo strftime(TIME_STR, strtotime($row['date_added'])) ?></td>
	<td class="fr hide768"><?php echo $row['ip'] ?></td>
	<td class="fr center hide480"><?php echo change_status($row['id'], $row['active'], 'active') ?></td>
	<td class="fr center" nowrap="nowrap">
		<?php if ($GLOBALS['per']['edit']) echo '<a href="'.current_url().'/reply/'.$row['id'].$uri_str.'" title="Xem & trả lời"><div class="icon glyphicons list"></div></a>'; ?>
		<?php if ($GLOBALS['per']['del']) echo del_restore_link($row['id'], $row['deleted']) ?>
	</td>
</tr>
<?php
	}
}
else
{
	echo no_data_mes(8);
}
echo module_close();
?>